﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace TestStudent
{
    [TestClass()]
    public class CourseTest
    {
        [TestMethod()]
        public void AddStudentsTest()
        {
            Course target = new Course();
            Student toAdd = new Student("pesho", 12111);
            bool expected = true;
            bool actual = target.AddStudent(toAdd);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void AddSameStudentsTest()
        {
            Course target = new Course();
            Student toAdd = new Student("pesho", 12116);
            bool expected = false;
            bool actual = target.AddStudent(toAdd);
            actual = target.AddStudent(toAdd);
        }

        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void AddOver30StudentsTest()
        {
            Course target = new Course();
            for (int i = 1; i < 32; i++)
            {
                Student toAdd = new Student(i.ToString(), i + 10000);
                target.AddStudent(toAdd);
            }
        }

        [TestMethod()]
        public void RemoveStudentSuccessTest()
        {
            Course target = new Course(); // TODO: Initialize to an appropriate value
            Student first = new Student("pesho", 12345);
            Student second = new Student("gosho", 12344);
            target.AddStudent(first);
            target.AddStudent(second);
            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual = target.RemoveStudent(12345);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void RemoveStudentFailTest()
        {
            Course target = new Course(); // TODO: Initialize to an appropriate value
            Student first = new Student("pesho", 22345);
            Student second = new Student("gosho", 22344);
            target.AddStudent(first);
            target.AddStudent(second);
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual = target.RemoveStudent(12745);
            Assert.AreEqual(expected, actual);
        }
    }
}
